Devices including or coupled to one or more digital cameras use a camera lens to focus incoming light onto a camera sensor for capturing digital images. The camera lens has a focal length that places a range of depth of the scene in focus. Portions of the scene closer or further than the range of depth may be out of focus, and therefore appear blurry in a resulting image. The distance of the camera lens from the camera sensor indicates the distance of the range of depth for the scene from the camera lens that is in focus. Many devices are capable of moving the camera lens to adjust the distance between the camera lens and the camera sensor, thereby adjusting which portions of a scene appear in focus for captured images.
A device may attempt to determine the position of the camera lens to place a portion of interest of the scene in focus. In one example, a user may touch an area of a preview image provided by the device (such as a person or landmark in the previewed scene) to indicate the portion of the scene to be in focus. In another example, the device may automatically determine a portion of the scene to be in focus. In response, the device may perform autofocus (AF) operations to automatically adjust the camera lens position so that the portion of the scene is in focus for subsequent image captures.
Changes in the scene, such as the user moving the camera or objects entering or exiting the scene, may cause the device to determine that the camera lens position may need to be adjusted. For example, an object entering the scene may cause a device to retrigger AF operations for determining a camera lens position. For some AF operations, devices may use information sensed by the camera sensor or a separate ranging system in creating a depth map for the scene. The depth map indicates depths of different portions of a scene from the camera or ranging system. The depth map may be used for AF operations as well as other operations, such as object recognition and detection.